const fs = require('fs')
const path = require('path')
const fileName = path.resolve(__dirname, 'data.txt')

// 判断文件是否存在
fs.exists(fileName, exist=>{
  console.log('exist：',exist)
})